package com.trkj.property_controller;

import com.trkj.entity.CarEntity;
import com.trkj.service.CarService;
import com.trkj.vo.AjaxResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Slf4j
@CrossOrigin
public class CarController {
    @Resource
    private CarService carService;
    //查询车辆
    @PostMapping("/CarList")
    public AjaxResponse CarList(@RequestBody CarEntity carEntity){
        return AjaxResponse.success(carService.CarList(carEntity));
    }
    //根据房屋id查车位的信息
    @PostMapping("/CarXinXi/{id}")
    public AjaxResponse CarXinXi(@PathVariable("id") int id){
        return AjaxResponse.success(carService.CarXinXi(id));
    }
    //查询所有车辆
    @PostMapping("/CarQuantity")
    public AjaxResponse CarQuantity(){
        return AjaxResponse.success(carService.CarQuantity());
    }
}
